
minetest.register_on_craft(function(itemstack, player)
	if minetest.setting_getbool("lunomobs_quests")==true then
	
	
		if itemstack:get_name() == "default:sword_stone" and lunomods.getCharValue(name, "quest(craft_swordstone)")~=true then
			lunomods.setCharValue(name, "quest(craft_swordstone)", true)
			minetest.sound_play("sfx_levelup", {object = player, max_hear_distance = 15})
			minetest.chat_send_player(player:get_player_name(), "Voce conclui a missao de criar uma espada de pedra!")
		end
		
		
	end
end)

lunomobs.checkQuests = function(player)
	if minetest.setting_getbool("lunomobs_quests")==true then
		local name = player:get_player_name()
	
	
		--matar 30 ladroes
		local KilledThiefs = lunomods.getCharValue(name, "kill(lunomobs:thief)") or 0
		local seQuestThief30 = lunomods.getCharValue(name, "quest(kill_thief30)") or false
		if KilledThiefs>=30 and seQuestThief30~=true then
			lunomods.setCharValue(name, "quest(kill_thief30)", true)
			--minetest.sound_play("sfx_levelup", {pos=self.pos, max_hear_distance = 15})
			minetest.sound_play("sfx_levelup", {object = player, max_hear_distance = 15})
			minetest.chat_send_player(player:get_player_name(), "Voce conclui a missao de vencer 30 ladroes!")
		end
		
		
	end
end

--[[
local timer = 0
minetest.register_globalstep(function(dtime)
	timer = timer + dtime;
	if timer >= 5 then
		-- Send "Minetest" to all players every 5 seconds
		--lunomobs.checkQuests()
		minetest.chat_send_all("Minetest...")
		timer = 0
	end
end)
]]--
